package com.snbc.Exception;

import java.math.BigDecimal;

/**
 * @Classname TestCheckingAccount
 * @Description TODO
 * @Date 2019/9/15 22:59
 * @Created by Acer
 */
public class TestCheckingAccount {

    public static void main(String[] args) {
        BigDecimal bd1 = new BigDecimal("0.00");
        BigDecimal bd2 = new BigDecimal("1000.00");
        BigDecimal bd3 = new BigDecimal("1000.89");
        BigDecimal bd4 = new BigDecimal("2200.89");
        System.out.println("===========开户==============");
        CheckingAccount checkingAccount = new CheckingAccount(bd1, bd2);
        System.out.println("===========查询账户余额==============");
        System.out.println("当前账户余额：" + checkingAccount.getBalance());
        System.out.println("============存款=============");
        checkingAccount.deposit(bd3);
        System.out.println("===========取款==============");
        try {
            checkingAccount.withdraw(bd4);
        } catch (OverdraftException e) {
            e.printStackTrace();
        }
    }
}
